package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ViewEquipmentDataMapper;
import com.ruoyi.system.domain.ViewEquipmentData;
import com.ruoyi.system.service.IViewEquipmentDataService;

/**
 * VIEWService业务层处理
 * 
 * @author zbm
 * @date 2023-06-29
 */
@Service
public class ViewEquipmentDataServiceImpl implements IViewEquipmentDataService 
{
    @Autowired
    private ViewEquipmentDataMapper viewEquipmentDataMapper;

    /**
     * 查询VIEW
     * 
     * @param equipmentName VIEW主键
     * @return VIEW
     */
    @Override
    public ViewEquipmentData selectViewEquipmentDataByEquipmentName(String equipmentName)
    {
        return viewEquipmentDataMapper.selectViewEquipmentDataByEquipmentName(equipmentName);
    }

    /**
     * 查询VIEW列表
     * 
     * @param viewEquipmentData VIEW
     * @return VIEW
     */
    @Override
    public List<ViewEquipmentData> selectViewEquipmentDataList(String equipmentName, String equipmentType, String createTime, String dataType, String dataValue, Date startTime, Date endTime)
    {
        return viewEquipmentDataMapper.selectViewEquipmentDataList(equipmentName,equipmentType,createTime,dataType,dataValue,startTime,endTime);
    }

    /**
     * 新增VIEW
     * 
     * @param viewEquipmentData VIEW
     * @return 结果
     */
    @Override
    public int insertViewEquipmentData(ViewEquipmentData viewEquipmentData)
    {
        viewEquipmentData.setCreateTime(DateUtils.getNowDate());
        return viewEquipmentDataMapper.insertViewEquipmentData(viewEquipmentData);
    }

    /**
     * 修改VIEW
     * 
     * @param viewEquipmentData VIEW
     * @return 结果
     */
    @Override
    public int updateViewEquipmentData(ViewEquipmentData viewEquipmentData)
    {
        return viewEquipmentDataMapper.updateViewEquipmentData(viewEquipmentData);
    }

    /**
     * 批量删除VIEW
     * 
     * @param equipmentNames 需要删除的VIEW主键
     * @return 结果
     */
    @Override
    public int deleteViewEquipmentDataByEquipmentNames(String[] equipmentNames)
    {
        return viewEquipmentDataMapper.deleteViewEquipmentDataByEquipmentNames(equipmentNames);
    }

    /**
     * 删除VIEW信息
     * 
     * @param equipmentName VIEW主键
     * @return 结果
     */
    @Override
    public int deleteViewEquipmentDataByEquipmentName(String equipmentName)
    {
        return viewEquipmentDataMapper.deleteViewEquipmentDataByEquipmentName(equipmentName);
    }
}
